﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace phoneApp
{
    class WcfConnection
    {
        ServiceReference1.Service1Client client;

        public WcfConnection()
        {
            client = new ServiceReference1.Service1Client();
            client.OpenAsync();
        }

        public User login(String login, String password)
        {
            client.validCredentialsAsync(login, password);
            client.validCredentialsCompleted += new EventHandler
                <ServiceReference1.validCredentialsCompletedEventArgs>(client_validCredentialsCompleted);
            // check login
            
            return new User("test", "password", "lala", "fdsfd");
        }
        
        private void client_validCredentialsCompleted(object sender, ServiceReference1.validCredentialsCompletedEventArgs e)
        {

           var lala = e.Result;
        }
    }
}
